import axiosHttp from "../index";
import type { ApiResponse } from "../type";
import type { TaskModel } from "./model";
import type { CreateTaskParams, QueryTaskParams } from "./type";

export const getTaskList = (params: QueryTaskParams) => {
  return axiosHttp.get("/api/task/list", { params });
};

export const createTask = (data: CreateTaskParams) => {
  return axiosHttp.post<ApiResponse<TaskModel>>("/api/task/create", data);
};

export const getTaskDetail = (id: number) => {
  return axiosHttp.get<ApiResponse<TaskModel>>(`/api/task/${id}`);
};
